package org.bwgl.demo1.controller;

import org.springframework.web.bind.annotation.*;

@RestController
public class MyTest2 {
    @GetMapping(value = "test2")
    public String test2(String user){
        return user;
    }

    @GetMapping(value = "test3")
    public String test3(@RequestParam(value = "username",required = false) String user){
        return user;
    }

    @PostMapping(value = "test4")
    public String test4(String user,int age){
        return user + age;
    }

    @PostMapping(value = "test5")
    public String test5(@RequestBody User user){
        return user.toString();
    }
}
